package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.OrderTakingResponseList
import com.gexiaobao.pigeon.databinding.ItemFinishOrderDrippingBinding

/**
 * @Author      : hxw
 * @Date        : 2024/7/3 17:03
 * @Describe    :
 */
class AdapterFinishOrder : BaseQuickAdapter<OrderTakingResponseList, DataBindBaseViewHolder>(R.layout.item_finish_order_dripping) {
    override fun convert(holder: DataBindBaseViewHolder, item: OrderTakingResponseList) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemFinishOrderDrippingBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val name = item.contactName
        if (name.isNotEmpty()) {
            val result = name.substring(0, 1)
            holder.setText(R.id.tvPigeonCatcher, context.getString(R.string.Pigeon_catcher) + result + context.getString(R.string.master))
        }
    }
}